//package com.demo.config;
//
//import com.mongodb.MongoClient;
//import com.mongodb.MongoClientURI;
//import com.mongodb.client.MongoDatabase;
//import org.bson.Document;
//import org.noear.solon.annotation.Bean;
//import org.noear.solon.annotation.Configuration;
//import org.noear.solon.annotation.Inject;
//
//@Configuration
//public class MongoClientConfig {
//    @Inject("${mongodb.uri}")
//    private String uri;
//
////    @Bean
////    public MongoClient mongoClient1() {
////        MongoClient mongoClient = new com.mongodb.MongoClient(new MongoClientURI(mongoUrl));
////        MongoDatabase database = mongoClient.getDatabase("tasks");
////        MongoCollection<Document> simpleDataCollection = database.getCollection("simple_data");
////            return mongoClient;
//////        }
////    }
//    @Bean()
//    public MongoDatabase mongoClient1() {
//        MongoClient mongoClient = new com.mongodb.MongoClient(new MongoClientURI(uri));
//        return mongoClient.getDatabase("tasks");
//    }
//
////    @Bean
////    public MongoDatabase mongoClient2() {
////        // Replace the uri string with your MongoDB deployment's connection string
////        try (MongoClient mongoClient = MongoClients.create(uri)) {
////            MongoDatabase database = mongoClient.getDatabase("tasks");
//////            try {
//////                Bson command = new BsonDocument("ping", new BsonInt64(1));
//////                Document commandResult = database.runCommand(command);
//////                System.out.println("Connected successfully to server.");
//////            } catch (MongoException me) {
//////                System.err.println("An error occurred while attempting to run a command: " + me);
//////            }
////            return database;
////        }
////    }
//
//}
